<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<link rel="stylesheet" href="css/jquery.wysiwyg.css" type="text/css" media="screen" charset="utf-8" />
	
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:70px;
		}
		
        p {
            size: 12px;
        }
    
		
	</style>
	<script type="text/javascript" src = "js/jquery.js"></script>
</head>
<body class="body">
	<%@include file="same2.jsp" %>
	<div class="container">
		<div class="row">
		<%@include file="same.jsp" %>
			<div class="span9" >
				<div class="clear"></div>
				
				 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:10px">
					<li class="active">
						<a href="project.html"><i class="icon-folder-open"></i>资料>${requestScope.document.title }</a>
					</li>
				</ul>
				<div class="wall" style="border-top:none; border:1px solid #dddddd ">
					<div style="margin:20px">						
						<div style="margin:5px"><h3 style="display:inline">${requestScope.document.title }</h3><p style="font-size:14px;color:grey">${requestScope.document.user.username }${requestScope.document.time }</p></div><hr>
							 <div style="margin-left:3px"><p style="font-size:12px">${requestScope.document.content }</p></div>	
							 <h4 style = "margin-bottom:15px;margin-top:15px">发表评论</h4>
								<c:choose>
									<c:when test="${param.code == 1001 }">
										<div style = "color:red">评论成功！</div>
									</c:when>
								
								</c:choose>
								<form style="margin-left:5px" method = "post" action = "comment.jspx?id=${requestScope.document.id }">
									<div style = "width:500px">
									<textarea name="content" id="editor" style="width:415px" rows="3"></textarea>
									</div>
									<br>
									<button class="btn btn-primary " style = "margin-left:380px">发布</button>
								</form>
													
							
					</div>	
					<c:choose>
						<c:when test="${empty requestScope.commentlist}">			
									<div style="margin:20px">没有关于此资料的评论</div>
						</c:when>
						<c:otherwise>
							<c:forEach items = "${requestScope.commentlist}" var = "comment">	
								<div style="margin:20px">						
									<blockquote>
										  <p style="font-size:14px"> ${comment.content}</p>
										  <small>${comment.user.username}${comment.createtime}</small>
									</blockquote>						
								</div>
							</c:forEach>
						</c:otherwise>
					</c:choose>
					<div style="margin:20px"><a href="document.jspx">←返回资料列表</a></div>					
			</div>
		</div>
	</div>
</div>	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script src="js/jquery1.5.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/jquery.wysiwyg.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/default.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#myid li").eq(5).addClass("active");
			$("#myid i").eq(3).addClass("  icon-white");
			$("#editor").wysiwyg({autoGrow:true, controls:"bold,italic,underline,strikeThrough,|,undo,redo,|,indent,outdent,|,justifyLeft,justifyCenter,justifyRight,justifyFull,|,insertOrderedList,insertUnorderedList,insertHorizontalRule,|,h1,h2,h3,h4,h5|,insertTable"});
			
		});
		
	</script>	
</body>
</html>